package collegeInnovation;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;

public class RandomSelect {
    public static void main(String[] args) {
        try {
            ArrayList<String> nameList = new ArrayList<>();
            ArrayList<String> workList = new ArrayList<>();
            Collections.addAll(nameList,"杨东","秦相玉","金泽军","郭文鹏");
            String path = RandomSelect.class.getResource("work.txt").getPath();
            BufferedReader br = new BufferedReader(new FileReader(path));
            String line;
            while (null != (line = br.readLine())) {
                workList.add(line);
            }
            Collections.shuffle(nameList);//打乱顺序
            int index = 0;
            for (String s : nameList) {
                System.out.println(s+":"+workList.get(index++)+" "+workList.get(index++));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
